<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/commons/global.jsp" %>
<script src="${ctxPath}/static/ckeditor/ckeditor.js"></script>

<script type="text/javascript">
    $(function() {
        $('#trafficConsultEditForm').form({
            url : '${path}/trafficConsult/edit',
            onSubmit : function() {
                progressLoad();
                var isValid = $(this).form('validate');
                if (!isValid) {
                    progressClose();
                }
                return isValid;
            },
            success : function(result) {
                progressClose();
                result = $.parseJSON(result);
                if (result.success) {
                    parent.$.modalDialog.openner_dataGrid.datagrid('reload');//之所以能在这里调用到parent.$.modalDialog.openner_dataGrid这个对象，是因为user.jsp页面预定义好了
                    parent.$.modalDialog.handler.dialog('close');
                } else {
                    parent.$.messager.alert('错误', result.msg, 'error');
                }
            }
        });
        

    });
</script>
<div class="easyui-layout" data-options="fit:true,border:false">
    <div data-options="region:'center',border:false" title="" style="overflow-y: scroll;padding: 3px;">
        <form id="trafficConsultEditForm" method="post" enctype="multipart/form-data">
            <table class="grid">
                <tr>
                    <td>标题</td>
                    <td>
                        <input name="id" hidden value="${trafficConsult.id}">
                        <input name="title" type="text" placeholder="请输入标题" class="easyui-validatebox span2"
                               data-options="required:true" value="${trafficConsult.title}">
                    </td>
                </tr>
                <tr>
                    <td>内容</td>
                    <td>
                       <textarea name="content" id="content" rows="10" cols="80" >
                           ${trafficConsult.content}
                       </textarea>
                        <script type="text/javascript">
                            // Replace the <textarea id="editor1"> with a CKEditor
                            // instance, using default configuration.
                            CKEDITOR.replace('content');
                        </script>
                    </td>
                </tr>
                <tr>
                    <td>排序</td>
                    <td>
                        <input name="consultSort" value="${trafficConsult.consultSort}"  class="easyui-numberspinner" style="width: 140px; height: 29px;" required="required" data-options="editable:false">
                    </td>
                </tr>
                <tr>
                    <td>图片</td>
                    <td style="height: 500px"><img style="width: 100%;height: 100%;" src=" http://120.25.205.54/images${trafficConsult.picPath} "/>
                        <div><input type="file" name="file"></div>
                    </td>
                </tr>
            </table>
        </form>
    </div>
</div>